#ifndef OPERATEFORM_H
#define OPERATEFORM_H

#include "DGVGlobal.h"
#include "ui_operate.h"
/*!
    \class OperateForm
    \brief This class represents the operation form.

    It has three combo boxes to ask the user the operation and the two sources to apply the operation on.
*/
class DGV_EXPORT OperateForm : public QDialog
{
    Q_OBJECT

public:
    OperateForm(QWidget *parent = 0);
    virtual ~OperateForm();

    inline QComboBox* getComboBoxSource1()
    {   return ui.cbxDataSource1;   }
    inline QComboBox* getComboBoxSource2()
    {   return ui.cbxDataSource2;   }
    inline QComboBox* getComboBoxOperation()
    {   return ui.cbxOperation;   }
    inline bool getOperationType()
    {   return ui.cbxOperationType->isChecked();    }
    inline bool onlyViewedData()
    {   return ui.cbxOperationType->isChecked();    }
    inline bool isAFunction()
    {   return function;    }

public slots:
    void updateComboBoxStates(const QString &selectedOp);

protected:
    bool function; //!< Function operation? If so, don't need 2nd combo box.

    Ui::Operation ui;

    void setOperations();
    void createConnections();
};

#endif // OPERATEFORM_H
